package com.foreknow.polymorphism;

/**
 * @author shkstart
 * @create 2021-07-26 17:10
 */
public class Test {
    public static void main(String[] args) {
        Test test=new Test();
        Animal cat=new Cat("加菲猫",4);
        Animal duck=new Duck("唐小鸭",2);
        Animal penguin=new Penguin("海豚奇奇",0);

        System.out.println("动物名字"+"\t"+"腿的条数"+"\t"+"动物叫");
        System.out.println(cat.getName()+"\t"+cat.getLegNum()+"\t"+cat.shout());
        System.out.println(duck.getName()+"\t"+duck.getLegNum()+"\t"+duck.shout());
        System.out.println(penguin.getName()+"\t"+penguin.getLegNum()+"\t"+penguin.shout());


    }
}
